package com.itheima.mythread2;

import com.itheima.mythread.MyThread;

public class ThreadDemo {
    public static void main(String[] args) {
        //创建对象
        MyThread my = new MyThread();

        Thread t1 = new Thread(my);
        Thread t2 = new Thread(my);

        //给线程设置名字
        t1.setName("线程1");
        t1.setName("线程2");

        //开启线程
        t1.start();
        t2.start();
    }
}
